<template>
  <div class="container">
    <ul>
      <li v-for="item in game" :key="item.id">
        <div class="pic">
          <img :src="item.icon" alt="" />
        </div>
        <div class="txt">
          <p>{{ item.name }}</p>
          <div class="a">
            <span>状态:运营</span>
            <span>角色:{{ item.type }}</span>
            <span>更新时间:{{ item.time }}</span>
          </div>
          <div class="b">简介：{{ item.content }}</div>
          <div class="c">
            <button><a href="/gamecenter">游戏专区</a></button>
            <button><a href="/giftbag">领取礼包</a></button>
            <button><a href="/gamecenter">点击下载</a></button>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      game: [],
    };
  },
  mounted() {
    this.$http.centerApi.queryAll().then((res) => {
      this.game = res.data.data;
    });
  },
};
</script>

<style lang="scss" scoped>
li {
  background-color: #fff;
  padding: 20px 10px;
  border-bottom: 1px solid #aaa;
  margin-bottom: 10px;
  display: flex;
  .pic > img {
    width: 150px;
    margin-right: 30px;
  }
  .txt {
    p {
      font-size: 1.5em;
      font-weight: bold;
      margin-bottom: 20px;
    }
    .a {
      margin-bottom: 20px;
      span {
        margin-right: 20px;
      }
    }
    .b {
      margin-bottom: 20px;
    }
    .c {
      button {
        background-color: #fff;
        padding: 6px 30px;
        border: 2px solid #aaa;
        margin-right: 20px;
      }
      button:hover {
        background-color: #cc4e5a;
        a {
          color: white;
        }
      }
    }
  }
}
</style>
